<template>
  <configForm :configs="createForm" :server="clueTraceServer" :beforeSubmit="beforeSubmit" />
</template>

<script setup>
import { clueTraceServer } from '@/api/clue'
import { ref } from 'vue'
import ConfigForm from '@/components/CRUD/ConfigForm.vue'
const props = defineProps({
  clueId: Number
})
const createForm = ref([
  {
    label: '客户标签',
    key: 'tag',
    type: 'radio',
    required: true,
    value: 'A',
    defaultValue: 'A',
    options: [
      { label: 'A', value: 'A' },
      { label: 'B', value: 'B' },
      { label: 'C', value: 'C' },
      { label: 'D', value: 'D' },
    ],
  },
  {
    label: '约访',
    required: true, //
    key: 'is_visit',
    type: 'radio',
    props: { placeholder: '请选择是否约访' },
    defaultValue: false,
    options: [
      { label: '否', value: false },
      { label: '是', value: true },
    ],
  },
  {
    label: '跟进记录',
    key: 'remark',
    type: 'input', // 使用文本域输入
    props: { placeholder: '请输入跟进记录', type: 'textarea' },
  },
])
const beforeSubmit = (params) => {
  params.clue_id = props.clueId
  return params
}
</script>

<style scoped>
/* 可根据需要添加样式 */
</style>
